import type { Metadata } from "next";

export default function TermsOfUse() {
  return (
    <div className="prose mx-auto max-w-3xl">
      <h1>Terms of Use</h1>
      <p>
        <strong>Last updated:</strong> 3 December 2025
      </p>
      <p>
        This website and the Rallly software and services are operated by Stack
        Snap Ltd. References to &quot;we&quot;, &quot;us&quot; or
        &quot;our&quot; refer to Stack Snap Ltd.
      </p>
      <p>
        We provide you with this website and the Rallly software, including the
        hosted service at rallly.co and any self‑hosted enterprise editions,
        subject to your acceptance of these Terms of Use (&quot;Terms&quot;).
      </p>
      <p>
        By accessing or using our website, our hosted service, or a self‑hosted
        installation of Rallly obtained from us, you agree to be bound by these
        Terms.
      </p>

      <hr />

      <h2>1. Scope</h2>
      <p>1.1 These Terms apply to:</p>
      <ul>
        <li>
          Your use of the <strong>website</strong> at rallly.co.
        </li>
        <li>
          Your use of the <strong>hosted Rallly service</strong> at rallly.co
          (if you create an account).
        </li>
        <li>
          Where explicitly stated, your use of{" "}
          <strong>self‑hosted / enterprise licenses</strong> of the Rallly
          software that you purchase from us (for example, a &quot;Rallly v4
          Enterprise License&quot;).
        </li>
      </ul>
      <p>
        1.2 Additional or different terms may apply to self‑hosted, on‑premise,
        or enterprise licenses as set out in Section 5 below or in a separate
        written agreement between you and us. If there is a conflict between
        these Terms and a signed agreement, the signed agreement will control.
      </p>

      <hr />

      <h2>2. Use of Website and Hosted Service</h2>
      <p>
        2.1 You may use this website and the hosted Rallly service only for
        lawful purposes and in accordance with these Terms.
      </p>
      <p>2.2 You must not use the website or hosted service in any way that:</p>
      <ul>
        <li>Causes or may cause damage to the website or service,</li>
        <li>
          Impairs the availability or accessibility of the website or service,
          or
        </li>
        <li>
          Is unlawful, fraudulent, harmful, or infringes the rights of others.
        </li>
      </ul>
      <p>
        2.3 You are responsible for keeping your account credentials
        confidential and for all activity under your account.
      </p>

      <hr />

      <h2>3. Purchases, Payments and No‑Refund Policy</h2>
      <p>
        3.1 All purchases and transactions made through this website or directly
        with us for Rallly licenses or services are{" "}
        <strong>final and non‑refundable</strong>, unless we are required to
        offer a refund under applicable law.
      </p>
      <p>
        3.2 By making a purchase or engaging in a transaction with us, you
        acknowledge and agree to this no‑refund policy.
      </p>
      <p>
        3.3 For certain products (including Rallly v4 Enterprise), we may
        require <strong>payment in advance</strong> before delivery of license
        keys or access details. Any such payment terms will be stated in our
        quote or invoice.
      </p>

      <hr />

      <h2>4. Links to Third‑Party Websites</h2>
      <p>
        This website may contain links to third‑party websites that are not
        owned or controlled by Stack Snap Ltd. We have no control over, and
        assume no responsibility for, the content, privacy policies, or
        practices of any third‑party websites.
      </p>

      <hr />

      <h2>5. Self‑Hosted</h2>
      <p>
        This section applies <strong>only</strong> to customers who have
        purchased a separate self‑hosted or enterprise license from us (for
        example, a &quot;Rallly v4 Enterprise License&quot;). It does{" "}
        <strong>not</strong> apply to users of the hosted service at rallly.co
        unless expressly agreed in writing.
      </p>

      <h3>5.1 License grant</h3>
      <p>
        Subject to your timely payment of all applicable fees, Stack Snap Ltd.
        grants you a non‑exclusive, non‑transferable, non‑sublicensable license
        to install and run the Rallly v4 software on your own infrastructure for
        use by your organization.
      </p>

      <h3>5.2 Perpetual license scope</h3>
      <p>If you purchase a Rallly v4 License on a perpetual basis:</p>
      <ul>
        <li>
          The license is perpetual for the purchased major version (v4.x).
        </li>
        <li>
          You are entitled to receive updates, bug fixes and minor releases
          within the v4.x product line at no additional license fee.
        </li>
        <li>
          Access to future major versions (for example, v5.x) may require a new
          license or an upgrade fee.
        </li>
      </ul>

      <h3>5.3 Restrictions</h3>
      <p>Unless we agree otherwise in writing, you must not:</p>
      <ul>
        <li>
          Resell, redistribute, or provide the self‑hosted software as a hosted
          service to third parties.
        </li>
        <li>Sublicense, rent, or lease the software to third parties.</li>
        <li>
          Attempt to circumvent any technical restrictions in the software.
        </li>
      </ul>
      <p>
        These restrictions do not limit any rights you have under the applicable
        open‑source licenses for the Rallly project codebase itself.
      </p>

      <h3>5.4 Open‑source components</h3>
      <p>
        Rallly includes open‑source components that are licensed under their own
        terms. To the extent of any conflict between these Terms and the
        applicable open‑source licenses, the open‑source licenses will govern
        your use of those components.
      </p>

      <h3>5.5 Support</h3>
      <p>Unless otherwise agreed in writing:</p>
      <ul>
        <li>
          A Rallly v4 Enterprise License includes email support for installation
          and configuration issues.
        </li>
        <li>We do not guarantee specific response times or service levels.</li>
        <li>No on‑site support is included.</li>
      </ul>

      <h3>5.6 Hosted‑service‑specific terms not automatically applicable</h3>
      <p>
        Sections of these Terms that relate specifically to the hosted service
        (such as account registration or data stored on our servers) do not
        apply to your self‑hosted installation, except where they are inherently
        relevant (for example, intellectual property, limitation of liability).
      </p>

      <hr />

      <h2>6. Limitation of Liability</h2>
      <p>
        To the maximum extent permitted by law, we will not be liable for any
        damages arising from the use or inability to use this website, the
        hosted service, or any self‑hosted installation of Rallly, including but
        not limited to direct, indirect, incidental, consequential, or punitive
        damages.
      </p>
      <p>
        Nothing in these Terms limits or excludes any liability that cannot be
        limited or excluded under applicable law.
      </p>

      <hr />

      <h2>7. Modifications to These Terms</h2>
      <p>
        We reserve the right to modify these Terms at any time, without prior
        notice to you. The &quot;Last updated&quot; date above will be revised
        when we make changes. Your continued use of the website, hosted service,
        or self‑hosted enterprise license after any modifications will
        constitute your acceptance of such modifications.
      </p>

      <hr />

      <h2>8. Contact</h2>
      <p>If you have any questions about these Terms, please contact us at:</p>
      <p>
        <strong>Email:</strong>{" "}
        <a href="mailto:support@rallly.co">support@rallly.co</a>
      </p>
      <p>
        <strong>Post:</strong>
        <br />
        Stack Snap Ltd.
        <br />
        The Gallery
        <br />
        14 Upland Road
        <br />
        London SE22 9EE
        <br />
        United Kingdom
      </p>
    </div>
  );
}

export function generateMetadata(): Metadata {
  return {
    title: "Rallly: Terms of Use",
    description: "The terms of use for Rallly.",
  };
}
